<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <ul id="list">
        <!-- <li>
            <h3></h3>
            <p></p>
            <strong></strong>
        </li> -->
    </ul>

    <script>

        const arr = [
            {
                goods_title : '手机1' , 
                goods_des : '手机拍照很6' ,
                goods_price : '899'
            } ,
            {
                goods_title : '手机1' , 
                goods_des : '手机拍照很6' ,
                goods_price : '899'
            } ,
            {
                goods_title : '手机1' , 
                goods_des : '手机拍照很6' ,
                goods_price : '899'
            } ,
            {
                goods_title : '手机1' , 
                goods_des : '手机拍照很6' ,
                goods_price : '899'
            } 
        ] ;


        // let html = '' ;
        // arr.forEach(item => {
        //     html +=`
        //     `
        // })


        const res = arr.reduce(function(html , item) {
            return html + `
                <li>
                    <h3>${item.goods_title}</h3>
                    <p>${item.goods_des}</p>
                    <strong>${item.goods_price}</strong>
                </li>
            `
        } , '')

        console.log(res);


    </script>
    
</body>
</html>